<!DOCTYPE html>
<html>

<body>

  <script src="iframe.js"></script>

  <script>
    function ok(result) {
      alert('result: ' + result);
    }

    function fail() {
      alert('fail');
    }
  </script>

  <button onclick="iframeGet('server', ok, fail)">iframeGet server</button>

  <button onclick="iframePost('diff', {clientDate: +new Date}, ok, fail)">iframePost diff</button>

</body>

</html>